{"ast":null,"code":"export const getUserName = user => {\n  if (user.firstName && user.lastName) {\n    return `${user.firstName} ${user.lastName}`;\n  }\n  return user.firstName || user.lastName || user.nickname;\n};\nexport const profileCompletionPercentage = profile => {\n  var _profile$content;\n  const maxPointer = 6;\n  let pointer = 0;\n  if (profile.email && profile.email) pointer++;\n  if (profile.nickname && profile.nickname) pointer++;\n  if (profile.firstName && profile.firstName) pointer++;\n  if (profile.lastName && profile.lastName) pointer++;\n  if (profile.verified) pointer++;\n  if (profile.content && ((_profile$content = profile.content) === null || _profile$content === void 0 ? void 0 : _profile$content.items.length) > 0) pointer++;\n  return pointer === 0 ? 0 : 100 / maxPointer / pointer;\n};","map":{"version":3,"names":["getUserName","user","firstName","lastName","nickname","profileCompletionPercentage","profile","maxPointer","pointer","email","verified","content","items","length"],"sources":["/data/messenger.client/src/utils/User.ts"],"sourcesContent":["import {UserListItem} from \"../models/response/UserListItem\";\n\nexport const getUserName = (user: UserListItem): string => {\n    if (user.firstName && user.lastName) {\n        return `${user.firstName} ${user.lastName}`;\n    }\n\n    return user.firstName || user.lastName || user.nickname;\n}\n\nexport const profileCompletionPercentage = (profile: UserListItem): number => {\n    const maxPointer: number = 6;\n    let pointer: number = 0;\n\n    if (profile.email && profile.email!) pointer++;\n    if (profile.nickname && profile.nickname!) pointer++;\n    if (profile.firstName && profile.firstName!) pointer++;\n    if (profile.lastName && profile.lastName!) pointer++;\n    if (profile.verified) pointer++;\n    if (profile.content && profile.content?.items.length > 0) pointer++;\n    \n    return (pointer === 0)? 0: 100/maxPointer/pointer;\n}"],"mappings":"AAEA,OAAO,MAAMA,WAAW,GAAIC,IAAkB,IAAa;EACvD,IAAIA,IAAI,CAACC,SAAS,IAAID,IAAI,CAACE,QAAQ,EAAE;IACjC,OAAQ,GAAEF,IAAI,CAACC,SAAU,IAAGD,IAAI,CAACE,QAAS,EAAC;EAC/C;EAEA,OAAOF,IAAI,CAACC,SAAS,IAAID,IAAI,CAACE,QAAQ,IAAIF,IAAI,CAACG,QAAQ;AAC3D,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAIC,OAAqB,IAAa;EAAA;EAC1E,MAAMC,UAAkB,GAAG,CAAC;EAC5B,IAAIC,OAAe,GAAG,CAAC;EAEvB,IAAIF,OAAO,CAACG,KAAK,IAAIH,OAAO,CAACG,KAAM,EAAED,OAAO,EAAE;EAC9C,IAAIF,OAAO,CAACF,QAAQ,IAAIE,OAAO,CAACF,QAAS,EAAEI,OAAO,EAAE;EACpD,IAAIF,OAAO,CAACJ,SAAS,IAAII,OAAO,CAACJ,SAAU,EAAEM,OAAO,EAAE;EACtD,IAAIF,OAAO,CAACH,QAAQ,IAAIG,OAAO,CAACH,QAAS,EAAEK,OAAO,EAAE;EACpD,IAAIF,OAAO,CAACI,QAAQ,EAAEF,OAAO,EAAE;EAC/B,IAAIF,OAAO,CAACK,OAAO,IAAI,qBAAAL,OAAO,CAACK,OAAO,qDAAf,iBAAiBC,KAAK,CAACC,MAAM,IAAG,CAAC,EAAEL,OAAO,EAAE;EAEnE,OAAQA,OAAO,KAAK,CAAC,GAAG,CAAC,GAAE,GAAG,GAACD,UAAU,GAACC,OAAO;AACrD,CAAC"},"metadata":{},"sourceType":"module"}